/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import dao.ArretCaisseDAO;
import dao.GuichetDAO;
import entity.ArretCaisse;
import entity.Guichet;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import org.jboss.weld.context.ejb.Ejb;

/**
 *
 * @author linos
 */
@ManagedBean(name = "caisseParGuichet")
@SessionScoped
public class CaisseParGuichet {

    @Ejb
    GuichetDAO guichetDAO = new GuichetDAO();
    @Ejb
    ArretCaisseDAO arretCaisseDAO = new ArretCaisseDAO();
    List<Guichet> guichets;
    List<ArretCaisse> arretCaisses;
    Guichet selectedGuichet;

    public CaisseParGuichet() {
    }

    public List<Guichet> getGuichets() {
        return guichetDAO.findAll();
    }

    public void setGuichets(List<Guichet> guichets) {
        this.guichets = guichets;
    }

    public Guichet getSelectedGuichet() {
        return selectedGuichet;
    }

    public void setSelectedGuichet(Guichet selectedGuichet) {
        this.selectedGuichet = selectedGuichet;
    }

    public List<ArretCaisse> getArretCaisses() {
        System.out.println(selectedGuichet.getId()+" dadsdas");
        arretCaisses=arretCaisseDAO.findByMontant(selectedGuichet.getId());
        return arretCaisses;
    }

    public void setArretCaisses(List<ArretCaisse> arretCaisses) {
        this.arretCaisses = arretCaisses;
    }
    
    
    
}
